package com.atguigu.string;
import org.junit.Test;
public class StringMethodTest4 {
    @Test
    //String->char[] 调用String的toCharArray
    //char->String  调用String的构造器
    public void test2(){
        String str1="abc123";
        char[] array=str1.toCharArray();
        for(char element:array){
            System.out.print(element+" ");
        }
        char[] arr=new char[] {'h','e','l','l','o'};
        String str2=new String(arr);
        System.out.println(str2);
    }
}
